-module(integers_list).
-export([start/1, stop/1]).

%%start
start(L) ->  
  spawn(fun() -> run(L) end).
  
stop(IntegerPid) ->
	IntegerPid ! {stop, self()},
	receive
		ok ->
			ok
	end.
  
%%run
run(L) ->
	receive
		{stop, ReplyPid} ->
			ReplyPid ! ok;
    {filter, ReplyPid, Function} ->
      ReplyPid ! lists:filter(Function, L),
      run(L)
	end.